﻿using System;
using System.Collections.Generic;
using Pay.DTO;
using Pay.TO;

namespace Pay.IService {
	public interface IBillService {
		#region 查询账单
		/// <summary>
		/// 平台的账务
		/// </summary>
		/// <param name="pay_channel"></param>
		/// <returns></returns>
		plat_bill_dto Get(PayChannel pay_channel);
		/// <summary>
		/// 平台账单列表
		/// </summary>
		/// <param name="billQuery"></param>
		/// <returns></returns>
		PagedResult<plat_bill_detail_dto> Get(BillQuery billQuery);
		/// <summary>
		/// 平台的账单明细
		/// </summary>
		/// <returns>The get.</returns>
		/// <param name="id">Identifier.</param>
		plat_bill_detail_dto Get(long id);

		/// <summary>
		/// 商户的账务
		/// </summary>
		/// <param name="user_id"></param>
		/// <returns></returns>
		bill_dto GetByMerchant(long user_id);
		/// <summary>
		/// 获取所有商户的账务
		/// </summary>
		/// <param name="billQuery"></param>
		/// <returns></returns>
		PagedResult<bill_ex> GetBills(BillQueryEx billQuery);
		/// <summary>
		/// 商户账单列表
		/// </summary>
		/// <param name="billQuery"></param>
		/// <returns></returns>
		PagedResult<bill_detail_dto> GetByMerchant(BillQuery billQuery);
		/// <summary>
		/// 商户账单明细
		/// </summary>
		/// <returns>The get.</returns>
		/// <param name="id">Identifier.</param>
		bill_detail_dto GetBillDetail(long id);
		#endregion
		/// <summary>
		/// 支付平台账单
		/// </summary>
		/// <returns>The account.</returns>
		/// <param name="kj_dic">Order identifier.</param>
		/// <param name="df_dic">Transter identifier.</param>
		int ChargeAccount(List<itp_model> kj_dic, Dictionary<string, decimal> df_dic, PayChannel payChannel, string code, profit_day_dto profit_day);

		/// <summary>
		/// 更新退款状态和流水号
		/// </summary>
		/// <param name="order_no">Order no.</param>
		IEnumerable<string> RefundAccount(string order_no, string transactionNo);

		#region 商户后台
		/// <summary>
		/// 账单
		/// </summary>
		/// <param name="model"></param>
		/// <returns></returns>
		bill_dto GetBill(head_req model);
		/// <summary>
		/// 账单明细
		/// </summary>
		/// <param name="model"></param>
		/// <returns></returns>
		PagedResult<bill_detail_dto> GetByBillDetail(bill_model model);
        #endregion
        /// <summary>
        /// 钱包 分销收益和店铺收益
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        PagedResult<token_wallet_bill_detail_dto> GetWalletBillDetails(WalletQuery query);
        /// <summary>
        /// 获取某用户某账单类型统计
        /// </summary>
        /// <param name="user_id"></param>
        /// <param name="bill_type"></param>
        /// <returns></returns>
        List<bill_detail_dto> GetBillDetail(long bill_id, BillType bill_type);
        /// <summary>
        /// 获取账单明细
        /// </summary>
        /// <param name="merchant_id"></param>
        /// <param name="bill_type"></param>
        /// <returns></returns>
        List<profit_dto> GetProfitList(long merchant_id, BillType bill_type);
        /// <summary>
        /// 供应商PC获得账单明细列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        PagedResult<spc_token_bill_detail_dto> SPC_GetProfitList(WalletQuery query);
    }
}
